package leetcode_301_400;

public class LeeCode_357 {
    public static void main(String[] args) {
        System.out.println(countNumbersWithUniqueDigits(2));
        System.out.println(countNumbersWithUniqueDigits(0));
    }
    private static int countNumbersWithUniqueDigits(int n) {
        if (n == 0)
            return 1;
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            if (i == 1){
                ans += 10;
                continue;
            }
            int tmp = 9;
            for (int j = 9 - i + 2; j <= 9; j++) {
                tmp *= j;
            }
            ans += tmp;
        }
        return ans;
    }
}
